<?php

/**
 * Erra_System_Renderer - Facade class for fields
 *
 * @package
 * @author Alexis Eric
 * @copyright Copyright (c) 2012 - Erra Prod
 * @version $1.0$
 * @access public
 */
class Erra_System_Renderer {

	/**
	 * Erra_System_Factory::renderField() - Displays a field
	 *
	 * @param mixed $field
	 * @param mixed $displayParameters
	 * @return
	 */
	public static function renderField($field, $displayParameters = null)
	{
		if (method_exists($field, '__render')) {
			return $field->__render($displayParameters);
		}
		return null;
	}

	/**
	 * Erra_System_Factory::renderFieldList() - Displays a field list
	 *
	 * @param mixed $field
	 * @param mixed $displayParameters
	 * @return
	 */
	public static function renderFieldList($field, $displayParameters = null)
	{
		if (method_exists($field, '__render_list')) {
			return $field->_render_list($displayParameters);
		}
		return null;
	}
}

?>